 App({
   globalData: {
     userInfo: null,
     ServiceUrl: 'https://chenjianfeng.xyz/album/',
    //  WXUrl: 'https://api.weixin.qq.com/sns/jscode2session',
     ValidateData: 'Epoint_WebSerivce_**##0601',
     appid: 'wx3be1f0317d73f3ac',
     secret: '9267b1056640e8d9067c442e503ec551',
     OPEN_ID:'',
     SESSION_KEY:'',
     nickname: '',
     uploadURL: 'https://up.qbox.me',
     domain: 'https://image.chenjianfeng.xyz/',
     region: 'ECN',
     uptokenURL:'https://chenjianfeng.xyz/album/qiniufile/getUpToken',
     zanUrl:"https://image.chenjianfeng.xyz/zan.jpg",
   },
  onLaunch: function () {
  },
  getUserInfo: function (cb) {
    var that = this
    if (this.globalData.userInfo) {
      typeof cb == "function" && cb(this.globalData.userInfo)
    } else {
      //调用登录接口
      wx.login({
        success: function () {
          wx.getUserInfo({
            success: function (res) {
              that.globalData.userInfo = res.userInfo
              typeof cb == "function" && cb(that.globalData.userInfo)
            }
          })
        }
      })
    }
  }
})